package com.pks.datacenter.entity.basic;

import java.util.HashMap;
import java.util.Map;

import lombok.Data;
import lombok.EqualsAndHashCode;

import com.pks.util.coder.database.DBField;
import com.pks.util.coder.database.DBQuery;
import com.pks.util.coder.database.DBTable;
import com.pks.web.mybatis.entity.BasicEntity;

@Data
@EqualsAndHashCode(callSuper = true)
@DBTable(tags = "标签库" )
public class Tag extends BasicEntity{
	
	private static final long serialVersionUID = -7544642920494904223L;
 
	public static final int TYPE_DBSOURCE = 1 ; 
	public static final int TYPE_APIMETHOD = 2;
	public static final int TYPE_APIUSER = 3;
	public static final Map<Integer, String> TYPE_MAP = new HashMap<Integer, String>();
	static {
		TYPE_MAP.put(TYPE_DBSOURCE, "数据源标签");
		TYPE_MAP.put(TYPE_APIMETHOD, "接口标签");
		TYPE_MAP.put(TYPE_APIUSER, "接口账号标签");
	}
	
	
	@DBQuery(value = {"="})
	@DBField(name = "type" , comment = "标签类型(1-数据源标签 2-接口标签 3-接口账号标签)" )
	private Integer type ; 	
	
	@DBQuery(value = {"="})
	@DBField(name = "pid" , comment = "上级ID" )
	private Long pid ; 	
	
	@DBQuery(value = {"=" , "like"})
	@DBField(name = "name", nullable = false , comment = "标签名称" , length = 100)
	private String name ; 
	
	@DBField(comment = "排序号")
	private Long orders;
	
	@DBField(name = "remark" , comment = "标签备注" , length = 255)
	private String remark ; 	
	
	@DBQuery(value = {"="})
	@DBField(name = "state" , comment = "状态 1-开启  0-关闭", defaultValue = "1" , length = 1)
	private Integer state;
	
}
